package com.aipolice.aipolice.pojo;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "connews_", schema = "aipolice", catalog = "")
public class Connews {
    private int id;
    private Integer deid;
    private String content;
    private String author;
    private Timestamp date;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "deid")
    public Integer getDeid() {
        return deid;
    }

    public void setDeid(Integer deid) {
        this.deid = deid;
    }

    @Basic
    @Column(name = "content")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "author")
    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    @Basic
    @Column(name = "date")
    public Timestamp getDate() {
        return date;
    }

    public void setDate(Timestamp date) {
        this.date = date;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Connews connews = (Connews) o;
        return id == connews.id &&
                Objects.equals(deid, connews.deid) &&
                Objects.equals(content, connews.content) &&
                Objects.equals(author, connews.author) &&
                Objects.equals(date, connews.date);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, deid, content, author, date);
    }
}
